package com.hue.gulimail.gulimailmember.web;

import com.hue.gulimail.gulimailmember.service.MemberService;
import com.hue.gulimail.gulimailmember.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @author 姚凤桥
 * @Date 2022/1/5 17:00
 * @Description:
 */
@Controller
public class MemberWebController {
    @Autowired
    private MemberService memberService;

    /**
     * 用户订单列表页
     *
     * @return
     */
    @GetMapping("/memberOrder.html")
    public String memberOrder(Model model) {
        //获取当前用户的所有订单信息
        List<OrderVo> orders = memberService.getOrders();
        model.addAttribute("orders", orders);
        return "orderList";
    }
}
